x86, cpuid: mask TSC invariant bit for PV and HVM domains if migration
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 9 Nov 2009 08:03:30 +0000 (08:03 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 9 Nov 2009 08:03:30 +0000 (08:03 +0000)
is not disabled and TSC is not emulated

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/domain.c

index 8f600d292576fe2d6d00704d4d959ae3f1975a8c..c851209853d2c091d0d83ffdbb8a03216c21dd8b 100644 (file)
@@ -2045,6 +2045,15 @@ void domain_cpuid(
             *ebx = cpuid->ebx;
             *ecx = cpuid->ecx;
             *edx = cpuid->edx;
+
+            /*
+             * Do not advertise host's invariant TSC unless the TSC is
+             * emulated, or the domain cannot migrate to other hosts.
+             */
+            if ( (input == 0x80000007) && /* Advanced Power Management */
+                 !d->disable_migrate && !d->arch.vtsc )
+                *edx &= ~(1u<<8); /* TSC Invariant */
+
             return;
         }
     }